package org.example.controller;

import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.example.pojo.DOperationlog;
import org.example.pojo.select.DApartmentSelect;
import org.example.pojo.select.DApplyApartmentSelect;
import org.example.pojo.select.DOperationLogSelect;
import org.example.service.DOperationlogService;
import org.example.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@CrossOrigin(origins = "*")
@RestController
@RequestMapping("operation")
@Tag(name = "日志数据API",description = "Operation Controller")
public class DOperationController {

    @Autowired
    private DOperationlogService dOperationlogService;

    @Operation(summary = "获取全部日志")
    @PostMapping("/selectAll")
    public Result<Map> SelectAll(@RequestBody DOperationLogSelect dOperationLogSelect){
        return dOperationlogService.SelectAllOperationLog(dOperationLogSelect);
    }

    @Operation(summary = "添加日志")
    @PostMapping("/addLog")
    public Result<Map> AddLog(@RequestBody DOperationlog dOperationlog){
        return dOperationlogService.AddLog(dOperationlog);
    }

    @Operation(summary = "删除日志")
    @PostMapping("/deleteLog")
    public Result<Map> DeleteLog(@RequestBody DOperationlog dOperationlog){
        return dOperationlogService.DeleteLog(dOperationlog);
    }
}
